package com.itheima.tanhua.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author Lff
 * @date 2022/4/8
 * -- 用户评分表
 * drop TABLE if EXISTS  `tb_score`;
 * CREATE TABLE `tb_score`(
 * uid BIGINT COMMENT '所属用户id' NOT NULL,
 * `level` INT COMMENT '对应问卷级别 1-初级，2-中级，3高级' NOT NULL,
 * `stars` INT COMMENT '题目难度 1-一颗星，2-两颗星..' NOT NULL,
 * score INT COMMENT '得分' NOT NULL,
 * personality_id BIGINT COMMENT '对应的结果描述id' NOT NULL,
 * checkpoints int COMMENT'当前关卡难度，计算公式为level*10+star' not null,
 * created datetime COMMENT '创建时间',
 * updated datetime COMMENT '修改时间'
 * );
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Score implements Serializable {
    private Long uid;//描述id
    private Long personalityId;//对应的结果描述id
    private Integer level;//题目级别 1-初级，2-中级，3高级
    private Integer stars;//题目难度 1-一颗星，2-两颗星,3-三颗星以此类推 最多五颗..
    private Integer score;//得分
    private Integer checkpoints;//当前关卡 => level * 10 + score
    private String dimensions;//纬度值 存储格式[{"理性","80%"},{"抽象","20%"}]
    @TableField(fill = FieldFill.INSERT)
    private Date created;//创建时间
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updated;//修改时间
}
